//
//  CLWifiMsgModel.m
//  togetherLBS
//
//  Created by Phyllis Hu on 15/7/21.
//  Copyright (c) 2015年 celi. All rights reserved.
//

#import "CLWifiMsgModel.h"

@implementation CLWifiMsgModel


+(instancetype)wifiMsgDict:(NSDictionary *)dict{
    
    CLWifiMsgModel *model = [[CLWifiMsgModel alloc]init];
    model.mac = dict[@"BSSID"];
    model.ssid = dict[@"SSID"];
    return model;
}


/**
 *  当从文件中解析出一个对象的时候调用
 *  在这个方法中写清楚：怎么解析文件中的数据
 */
- (id)initWithCoder:(NSCoder *)decoder
{
    if (self = [super init]) {
        self.mac = [decoder decodeObjectForKey:@"mac"];
        self.ssid = [decoder decodeObjectForKey:@"ssid"];
    }
    return self;
}

/**
 *  将对象写入文件的时候调用
 *  在这个方法中写清楚：要存储哪些对象的哪些属性，以及怎样存储属性
 */
- (void)encodeWithCoder:(NSCoder *)encoder
{
    [encoder encodeObject:self.mac forKey:@"mac"];
    [encoder encodeObject:self.ssid forKey:@"ssid"];

}


- (void)setChooseWifi:(bool)chooseWifi{
    
    _chooseWifi = chooseWifi;
    _isUpdate = !_isUpdate;
}
@end
